package cn.baage.campus.utils;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
 * @Description: http 工具
 * @Author: 八阿哥
 * @url: baage.cn
 * @Version: 1.0
 **/
public class ResultUtils
{
    /**
     * 将字符串渲染到客户端
     *
     * @param response 渲染对象
     * @param string 待渲染的字符串
     */
    public static void renderString(HttpServletResponse response, String string) throws IOException {
        response.setStatus(200);
        response.setContentType("application/json");
        response.setCharacterEncoding("utf-8");
        response.getWriter().print(string);
    }
}